﻿@{
    Layout = null;
}
<script type="text/javascript">
    $(function () {
        $.extend($.fn.validatebox.defaults.rules, {
            lessThan: {
                validator: function (value, param) {
                    var value = value.replace(/,*/g, "").replace("￥", "");
                    return (parseFloat(value) + parseFloat($(param[0]).val())) <= 0;
                },
                message: '收款金额不能大于欠款额。'
            }
        });
        $('#Paidup').click(function () {
            if ($('#ChargingMoney').numberbox('options')['disabled']) {
                $("#ChargingMoney").numberbox('enable');
                $("#ChargingDate").datebox('enable');
                $("#PayMethod").combobox('enable');
            }
            else {
                $("#ChargingMoney").numberbox('disable');
                $("#ChargingDate").datebox('disable');
                $("#PayMethod").combobox('disable');
            }
        })
    })
</script>
<form id="chargingForm" method="post">
<table class="grid" width="100%" cellspacing="0" cellpadding="0">
	<!--基本信息-->
	<tbody>
    <tr>
      <td>实收金额</td>
      <td>
          <input type="hidden" id="ID" name="ID" value=""/>
          <input type="hidden" id="OwingMoney" name="OwingMoney" value=""/>
          <input type="text" id="ChargingMoney" name="ChargingMoney"  class="easyui-numberbox easyui-validatebox" data-options="required:true,min:0,precision:2,groupSeparator:',',prefix:'￥'" validType="lessThan['#OwingMoney']" >
      </td>
      <td>收费日期</td>
      <td>
          <input id="ChargingDate" name="ChargingDate" type="text" class="easyui-datebox" data-options="required:true"></input>
      </td>
      <td>收款方式</td>
      <td>
          <input id="PayMethod" name="Paymethod" class="easyui-combobox" data-options="    
				valueField: 'ID',    
				textField: 'Name',
				url: '@Url.Content("~/Main/GetPaymethod")', 
				onLoadSuccess: function(rec){
					if(rec){
						$(this).combobox('setValue',rec[0].ID);
					}
				}" />
      </td>
    </tr>
    <tr>
      <td>免除余款</td>
      <td colspan="5">
        <input type="checkbox" name="Paidup" id="Paidup" value="1" onchange="$" />
      </td>
    </tr>
</tbody>
</table>
</form>
